function photoStartCtrl($scope,$http,$state){
    $http({
        method: "GET",
        url: 'http://localhost:8080/photos',
    }).then(function successCallback(response) {
            console.log("response:"+response);
            console.log(response);
            $scope.photodata=response.data;
            $scope.allpath=$scope.photodata;

        },
        function errorCallback(response) {
            console.log("error")
            console.log(response);
        });


    $scope.gotoLogin = function () {
        $state.go('login');
    };

    $scope.gotoRegister = function () {
        $state.go('register');
    };



    $scope.click1=function () {
        $http({
            method: "GET",
            url: 'http://localhost:8080/photosbytype',
            params:{InputType:$scope.InputType},
        }).then(function successCallback(response1) {
                console.log("response:"+response1);
                console.log(response1);
                if($scope.InputType.toString().length!=0){
                $scope.photodata=response1.data;
                }else {
                    $scope.photodata=$scope.allpath;
                }

            },
            function errorCallback(response) {
                console.log("error")
                console.log(response);
            });
    }
    $scope.translateto=function (photoid) {
        $http({
            method: "POST",
            url: 'http://localhost:8080/photopath',
            params:{Nowpath:photoid},
        }).then(function successCallback(response1) {
                console.log("response:"+response1);
                console.log(response1);
                var message = response1.resultMessage;
                if(message=="success"){
                    $state.go('photoIntro')
                }
            },
            function errorCallback(response) {
                console.log("error")
                console.log(response);
            });
    }
}
